package ${ftl_service_package}.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.base.web.common.BaseRepository;
import com.base.web.common.impl.BaseServiceImpl;
import ${ftl_domain_package}.${className};
import ${ftl_jpa_package}.${className}Repository;
import ${ftl_service_package}.I${className}Service;

/**
 * Service：${tableInfo.table_comment?if_exists}.
 * @author ${ftl_author}
 * @since ${ftl_now}
 * @version ${ftl_version}
 */
@Service
@Transactional
public class ${className}Service extends BaseServiceImpl<${className}, ${idType}> implements I${className}Service {

    @Autowired
    private ${className}Repository ${className?uncap_first}Repository;

    @Override
    public BaseRepository<${className}, ${idType}> geBaseRepository() {
        return ${className?uncap_first}Repository;
    }

    /**
     * 根据编号查询单个对象
     */
    @Override
    @Transactional(readOnly = true)
    public ${className} findOne(${idType} id) {
        return ${className?uncap_first}Repository.findOne(id);
    }

    /**
     * 根据编号列表查询对象列表
     * @param ids 编号列表（逻辑主键）
     */
    @Override
    @Transactional(readOnly = true)
    public List<${className}> findList(List<${idType}> ids) {
        return ${className?uncap_first}Repository.findList(ids);
    }

    /**
     * 根据编号逻辑删除
     * @param id （逻辑主键）
     */
    @Override
    public void delete(${idType} id) {
        ${className?uncap_first}Repository.delete(id);
    }

}
